package cn.ligoo.dtu.server.codec;

import java.nio.charset.Charset;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DtuEncoder extends ProtocolEncoderAdapter {
	private final Logger logger = LoggerFactory.getLogger(DtuEncoder.class);
	private final Charset charset;

	public DtuEncoder(Charset charset) {
		this.charset = charset;
	}

	@Override
	public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception {
		logger.debug("......encode");
		charset.newEncoder();
		// do nothing
	}
}